package ch.zbw.sysventory.agent.scanner.xml.impl;

import java.io.FileWriter;

import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.XMLContext;

import ch.zbw.sysventory.agent.scanner.xml.ScanResultXmlWriter;
import ch.zbw.sysventory.transport.model.ScanResult;

public class ScanResultXmlWriterImpl implements ScanResultXmlWriter {

	@Override
	public void writeScanResultToXml(ScanResult scanResult) throws Exception {
		XMLContext context = new XMLContext();
		Marshaller marshaller = context.createMarshaller();
		marshaller.setWriter(new FileWriter("latestScanResult.xml"));
		marshaller.marshal(scanResult);
	}

}
